package sg.edu.nus.iss.vmcs.interfaces;

import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;

import sg.edu.nus.iss.vmcs.customer.CoinInputCommand;
import sg.edu.nus.iss.vmcs.system.MainController;

public class SWTCustomerPanelListener implements Listener {

	private CoinInputCommand coinInputCommand;
	
	public SWTCustomerPanelListener(sg.edu.nus.iss.vmcs.customer.CoinReceiver coinReceiver) {
		coinInputCommand = new CoinInputCommand(coinReceiver);
	}
	@Override
	public void handleEvent(Event event) {
	  int value = (Integer)event.widget.getData("Value");
	  System.out.println("=========>"+value);
	  coinInputCommand.execute(value);
	  
	}

}
